<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
<script>
// class Box {
//     // 私有
//     private name = 'blue'
// }
// 立即执行函数 是闭包吗？
(function() { // 作用域
    let name = '计涛'
    return class {
        // private name
        get name() {
            ruturn `名叫${name}`
        }
        set name(val) {
            name = val
        }
    }
})()

let box = new Box();
// name
box.name = '小红'
</script>
</body>
</html>